<template>
	<view class="cu-modal" :class="showModal?'show':''" >
		<view class="cu-dialog">
			<view class="cu-bar bg-blue u-f-ajc solid-bottom">
				<view class="modal-title">{{modalTitle}}</view>
			</view>
			<view>
				<slot name="content"></slot>
			</view>
			<view class="cu-bar bg-white solid-top" v-if="showCancelFlag||showOkFlag">
				<view v-if="showCancelFlag" class="action margin-0 flex-sub solid-right" @tap="cancelModal"></view>
				<view v-if="showOkFlag" class="action margin-0 flex-sub solid-left text-blue" @tap="okModal">{{okText}}</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			modalTitle:{
				type:String,
				default:"标题",
			},
			showModal:{
				type:Boolean,
				default: false,
			},
			// okText:{
			// 	type: String,
			// 	default: "提交"
			// },
			cancelText:{
				type: String,
				default: "取消"
			},
			showCancelFlag:{
				type: Boolean,
				default: true,
			},
			showOkFlag:{
				type: Boolean,
				default: false,
			}
		},
		methods:{
			cancelModal(e){
				this.$emit("cancelModal");
			},
			okModal(e){
				this.$emit("okModal");
			}
			
		}
	}
</script>

<style scoped>
	@import "main.css";
	.u-f-ajc{
		display: flex;
		align-items: center;
		justify-content: center;
	}
/* 	.bg-white{
		background-color: #3777FF;
		height: 40rpx;
		width: 640rpx;
		margin: auto;
		border-radius: 10rpx;
		margin-bottom: 40rpx;
	}
	 */
	
	.solid-right{
		background-color: #c8c7cc;
	}
	.bg-blue{
		background-color: #f8f8f8;
	}
	/* .margin-0{
		color: #fff;
	} */
	.modal-title{
		color: #000000;
		font-size: 35rpx;
	}
</style>
